<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>z-index定位叠放顺序</title>

    <style>
        .bgdiv {
            position: relative;
        }
        .box {
            position: absolute;
            top: 0;
            left: 0;
            width: 200px;
            height: 200px;
        }
        .div1 {
            z-index: 1;
            top: 30px;
            left: 30px;
            background-color: aqua;
        }
        .div2 {
            top: 60px;
            left: 60px;
            background-color: red;
        }
        .div3 {
            top: 90px;
            left: 90px;
            background-color: pink;
        }
    </style>

</head>
<body>
    <img src="定位的叠放顺序.png" alt="">
    <br><br>
    <div class="bgdiv">   
        <div class="box div1">div1</div>
        <div class="box div2">div2</div>
        <div class="box div3">div3</div>
    </div>
</body>
</html>